package com.violet.myorm.annotations;

import com.violet.myorm.core.enums.ForeignState;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target({java.lang.annotation.ElementType.FIELD})
public @interface ForeignKey {

    String foreign();       // 关联的表的字段名
    String field();         // 本表的字段名

    boolean lazy() default false;  // 是否懒加载

    ForeignState state() default ForeignState.NOT_NULL;
}
